<?php
class Ajax extends CI_Controller{
	function Ajax(){
		parent::__construct();
	}
	
	public function changeDefaultCategory($catId){
		
		$this->session->set_userdata('default_cat', $catId);	
		
		$message = "";
		$data = "";
		
		if($this->session->userdata('default_cat') == $catId){
			$message = "success";
			$data = $catId;
		}
		else {
			$message = "failed";
		}
		
		$output = '{"message": "'.$message.'","data": "'.$data.'"}';
		echo $output;
	}
}